keyMap = {
    "name": "材料名称",
    "type": "材料类型",
    "Density": "密度",
}

valueMap = {
    "材料名称": "name",
    "材料类型": "type",
    "密度": "Density",
}


def convertKey(data, type):
    res = {}
    if type == 0:
        for key, values in data.items():
            if valueMap.get(key):
                res[valueMap.get(key)] = values
            else:
                res[key] = values

    elif type == 1:
        for key, values in data.items():
            if keyMap.get(key):
                res[keyMap.get(key)] = values
            else:
                res[key] = values

    return res
